<template>
    <Drawer class-name="custom-drawer-wrap" width="300" closable v-model="props.visible">
        <div slot="header" class="header__wrap">
            <p class="title">编辑节点</p>
            <Button type="primary" size="small" @click="updateData">保存</Button>
        </div>
        <Input v-model="data.label"/>
    </Drawer>
</template>

<script setup>
    const props = defineProps({
        visible: {
            type: Boolean,
            default: false
        },
        data: {
            type: Object,
            default: {}
        }
    })
    const emit = defineEmits(['on-update'])
    const updateData = () => {
        emit('on-update', props.data)
    }
</script>

<style lang="scss">
    .custom-drawer-wrap {
        .header__wrap {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
            .title {
                padding-right: 15px;
            }
        }
    }
</style>
